package org.pine.controller;

import org.pine.entity.Book;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName HelloController
 * @Description hello控制器
 * @Author lzs
 * @Date 2021-02-07
 * @Version V1.0
 */
@RestController
public class HelloController {

    @GetMapping("/hello")
    public String hello(String name){
        return "Hello "+name+"!";
    }

    @PostMapping("/book")
    public String addBook(@RequestBody Book book){
        return book.toString();
    }
}
